#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
typedef unsigned long long ull;
const int N = 1e6 + 10;
string s;
int p = 13331;
int n;
int m;
ull f[N];
ull d[N];
void init_hash()
{
    d[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        f[i] = f[i - 1] * p + s[i];
        d[i] = d[i - 1] * p;
    }
}
ull gethash(int x, int y)
{
    return f[y] - f[x - 1] * d[y - x + 1];
}
int main()
{
    cin >> s;
    cin >> m;
    s = " " + s;
    n = s.size();
    init_hash();
    while (m--)
    {
        int l1, r1, l2, r2;
        cin >> l1 >> r1 >> l2 >> r2;
        ull ret1 = gethash(l1, r1);
        ull ret2 = gethash(l2, r2);
        if (ret1 != ret2)
        {
            cout << "No" << endl;
        }
        else
        {
            cout << "Yes" << endl;
        }
    }
    return 0;
}